import { v4 as uuidv4 } from 'uuid';
// 生成一个随机字符串，且每次执行不能发生变化，游客身份持久存储
export const getUUID = () => {
  // 先从本地存储获取uuid，如果没有则产生一份新的uuid
  let uuid_token = localStorage.getItem('uuidToken') || uuidv4();
  // 将uuid本地存储一次
  localStorage.setItem('uuidToken', uuid_token);
  return uuid_token;
}
